home *** CD-ROM | disk | FTP | other *** search
- #define DISABLE_LOCAL_CALLTRACE 1 // Set to 1 to disable Call Traces for this file.
- #define DISABLE_LOCAL_DEBUG 0 // Set to 1 to disable all debugging for this file.
- #include "DebugUtils.h"
-
- #include <Gestalt.h>
- #include <stdio.h>
- #include "DSNubInterface.h"
- #include "Notice.h"
- #include "Version.h"
-
-
-
-
-
- DeviceShareNubInfo *GetDSNubInfo(void)
- {
- DeviceShareNubInfo *info = NULL;
- OSStatus err;
-
-
- // Get DeviceShareNubInfo pointer from Gestalt.
- err = Gestalt(kDeviceShareSelector,(long*)&info);
- if (err != noErr)
- info = NULL;
-
- // Check for the DeviceShareNub being installed and loaded.
- if ((err != noErr) || (info == NULL) || (info->signature != kDeviceShareSignature))
- {
- PreflightNotice(true);
- PostNotice(kAlertStopAlert,"\pThe DeviceShare Control Panel is not installed.",
- "\pThe DeviceShare Control Panel must be placed inside the Control Panels Folder" \
- "\p and loaded during startup before this Control Panel can be opened.");
- ExitToShell();
- }
-
- // Check for the DeviceShareNub being a compatible version. Since the nub and the
- // app are bundled in the same file we require that their versions match exactly.
- if ((kDeviceShareCompatible != *(UInt32*)&info->compatible) || (kDeviceShareVersion != *(UInt32*)&info->version))
- {
- Str255 msg;
- char nubVers[32],ourVers[32];
-
- GetNumVersionCString(ourVers);
- msg[0] = sprintf((char*)&msg[1],"The installed DeviceShare Control Panel is version %s. This " \
- "Control Panel is version %s. You need to open the installed Control Panel, or remove " \
- "it and install this Control Panel.",NumVersionToCString(nubVers,(NumVersion*)&info->version),ourVers);
-
- PreflightNotice(true);
- PostNotice(kAlertStopAlert,"\pThis DeviceShare Control Panel is incompatible.",msg);
- ExitToShell();
- }
-
- return info;
- }
-